<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="s" uri="/struts-tags"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    
    <title>My JSP 'Orderdetail.jsp' starting page</title>
    
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	<link rel="stylesheet" type="text/css" href="<%=basePath%>/css/biaoge.css"/>
   <script type="text/javascript" src="jquery/js/jquery-1.8.2.js"></script> 
  </head>
  <script type="text/javascript">
  function updatecost(orderid){
      var costname=document.getElementsByName("costname");
      var costmoney=document.getElementsByName("costmoney");
      var cosname="",cosmoney="";
     for(var i=0;i<costname.length;i++){
       cosname+=costname[i].value+",";
       cosmoney+=costmoney[i].value+",";
     }
      //alert(cosname+"   "+cosmoney+"  "+orderid);
      $.post(
       "updatelabelcost",
       {costname:cosname,costmoney:cosmoney,orderid:orderid},
       function(data){
       alert("修改成功");
       },
      "json"
      );
  }
  
  function aaaaa(){
    var wen=document.getElementById("wenjian").value;
   /*   var tt=wen.split(".");
     alert(tt[1]); */
  var objReg = new RegExp("[.]+(cdr)$", "gi");
  if(objReg.test(wen))
  {
   
    return true;
    }
    else{
    alert("文件格式不正确");
    return false;
    }
  }
  </script>
  <body>
  
 
  <img alt="" src="${order.orderPic}"style="height:250px;width:150px;margin-left:300px;margin-top:150px"/><br/>

  <div style="margin-left:560px;margin-top: -250px">
   用户名称：${order.userName}<br>
   订单名称：${order.orderName}<br>
   用户电话：${order.orderMobilePhone}<br>
   快递信息：${order.orderFreight}<br>
   订单数量：${order.orderProductsCount}<br>
   订单总价：${order.orderTotalPrice}<br>
   送货地址：${order.orderAddress}<br><br>
<c:if test="${!empty order.stockoutReason}">
  此订单未发出！原因为：<font size="2" color="red">${order.stockoutReason}</font><br><br>
</c:if>

<c:if test="${!empty order.costFeedback}">
 工厂反馈内容是：<font size="2" color="blue">${order.costFeedback}</font><br>
  <c:forEach items="${maplist}" var="mapli">
     <input type="hidden" name="costname" value="${mapli.labelcostname}">${mapli.labelcostname}:<input type="text" style="width:100" name="costmoney" value="${mapli.labelcostmoney}"><br>
      </c:forEach>
      <input type="button" value="确定" onclick="updatecost('${order.orderId}')">
</c:if>
  <form action="upCDR" method="post" enctype="multipart/form-data" onsubmit="return aaaaa();">
   <input type="hidden" name="orderid" value="${order.orderId}">
   <input type="hidden" name="username" value="${order.userName}">
 cdr文件上传：<input id="wenjian" type="file" name="file">
					<font id="userfont" color="red">
						接受cdr图片格式的文件</font><br>
			<input type="submit" value="上传cdr文件" style="margin-left: 150">
		<%-- 	${wen}
			<s:actionerror/>
			<s:actionmessage/>	
			<s:fielderror key="wen"></s:fielderror>		 --%>
	</form>	
	</div>
				
  </body>
</html>
